package cn.sytton.taffe.web.flw.service;

import cn.sytton.taffe.framework.base.entity.PageParam;
import cn.sytton.taffe.framework.base.service.IBaseService;
import cn.sytton.taffe.web.flw.entity.FlowDefEntity;
import cn.sytton.taffe.web.flw.entity.FlowInstanceVariableEntity;
import cn.sytton.taffe.web.flw.entity.FlowTaskEntity;
import cn.sytton.taffe.web.flw.entity.FlowTaskVariableEntity;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

/**
 * 流程运行 服务层接口
 *
 * @author skyrock
 */
public interface IFlowRunService extends IBaseService<FlowDefEntity> {

    /**
     * 查询待办
     * @param pp
     * @return
     */
    PageInfo<FlowTaskEntity> findTodoPage(PageParam pp);

    /**
     *  启动流程
     * @param fiv
     */
    String start(FlowInstanceVariableEntity fiv, String processDefKey, String processDefId);

    /**
     * 完成Task
     * @param ve
     */
    void complete(FlowTaskVariableEntity ftv);

    /**
     * 查询流程任务
     * @param processInstanceId
     * @return
     */
    List<FlowTaskEntity> findTaskByProcessInstanceId(String processInstanceId);

    /**
     * 查询Task
     * @param taskId
     * @return
     */
    List<Map<String, Object>> findTaskById(String taskId);
}
